<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>hello</title>
    <!-- 导入vue包 -->
    <script src="./lib/vue2.6.10.js"></script>
</head>
<body>
    <div id="app">
        <my-com4></my-com4>

    </div>

    <template id="tmp1">
        <div>
            <h3>4.这是用template 在app外部定义的组件模板</h3>
            <p>{{msg}}</p>
        </div>
    </template>
    <script>
       
        Vue.component('myCom4',{
            template: "#tmp1",
            data() {
                return {
                    msg: '这是组件自己的data'
                }
            },
        });

        var vm = new Vue({
            el: "#app"
        });
    </script>
</body>
</html>